import {Component } from '@angular/core';
import {Events, IonicPage, ViewController} from 'ionic-angular';

/**
 * Generated class for the ChoselinePage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */
interface listItem {
  linename: string,
  id: string,
  status: boolean
}


@IonicPage()
@Component({
  selector: 'page-choseline',
  templateUrl: 'choseline.html',
})
export class ChoselinePage {

  private title:String = '';
  private lists:Array<listItem>;
  private  radioresult:any;

  constructor(
    public viewCtrl: ViewController,
    private events: Events
    ) {
    this.title = this.viewCtrl.data.title;
    this.lists = this.viewCtrl.data.datalists;
  }

  cancelchose(){
    //  取消选择
    this.viewCtrl.dismiss()
  }

  doublechose(){
    console.dir(this.radioresult)
    var choseobj = this.lists[this.radioresult];
    this.events.publish('choseres',choseobj);
    this.viewCtrl.dismiss()
  }

}
